package cn.fanqinghong.ymcc.feignClient;

import cn.fanqinghong.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * FAN
 * 2022/7/27  18:55
 */
@Component
public class CourseUserLearnFallbackFactory implements FallbackFactory<CourseUserLearnFeignClient> {
    @Override
    public CourseUserLearnFeignClient create(Throwable throwable) {
        return new CourseUserLearnFeignClient() {
            @Override
            public JSONResult searchUserLearn(Long courseId, Long loginId) {
                return JSONResult.error("查询权限失败");
            }

            @Override
            public JSONResult courseOrderInfo(String courseIds) {
                return JSONResult.error("查询课程失败");
            }
        };
    }
}
